<%--
  Created by IntelliJ IDEA.
  User: xixi
  Date: 2024/3/5
  Time: 23:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<c:forEach items="brands" var="brand" varStatus="status">
    <%-- 其中brands属性代表被遍历的容器，var属性代表遍历产生的临时变量 varStatus属性代表遍历状态对象--%>
    <tr align="center">
<%--        <td>${brand.id}</td>--%>
        <td>${status.index}</td>
        <td>${brand.brandName}</td>
        <td>${brand.companyName}</td>
        <td>${brand.order}</td>
        <td>${brand.description}</td>
        <c:if test="${brand.status == 1}">
            <td>启用</td>
        </c:if>
        <c:if test="${brand.status != 0}">
            <td>禁用</td>
        </c:if>
    </tr>

</c:forEach>

<c:forEach begin="0" end="2" step="1" var="i">
    <%--其中begin属性是开始位置、end属性是结束位置、step属性是步长、var是循环遍历i--%>
    <%-- 相当于for(int i=0;i<2;i++) --%>
    ${i}
</c:forEach>

</body>
</html>
